s=int(input())
x=0
while "()"  in s or "[]" in s or "{}" in s or "<>" in s:
    s=s.replace("()","")
    s=s.replace("[]","")
    s=s.replace("{}","")
    s=s.replace("<>","")
    x=1
if x==1:
    print("TRUE")
else:
    print("FALSE")
